package fr.pud.client.controller.address;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import fr.pud.client.view.JMapViewerExtended;

/**
 * The controller which enables to add an address by doing a right-click on
 * the map.
 * Apr 8, 2012 - OSE
 * @author Simon Devineau, Adrien Hierry, Leopold Houdin, Pierre Reliquet
 *         Ecole des Mines de Nantes
 *         AddAddress.java
 */
public class AddAddressTODELETE extends MouseAdapter {
    /**
     * The singleton JMapViewer
     */
    private JMapViewerExtended map = JMapViewerExtended.getJMapViewer();

    /**
     * The action when the mouse is clicked
     * @param the
     *            event associated to the click.
     */
    @Override
    public void mouseClicked(MouseEvent e) {
        this.map.getLocation(this.map.getContextMenu().getLocationOnScreen().x,
                this.map.getContextMenu().getLocationOnScreen().y);
        this.map.getContextMenu().setVisible(false);
        // System.out.println("Marker number : "+map.getMapRouteList());
        // MapAddress m=new
        // MapAddress(map.getPosition(p),true,map.getMapMarkerList().size()+1);
        // map.addMapMarker(m);
    }
}
